<?php
try {
    $conn = new pdo('mysql:host=localhost', 'root', '');
    echo '连接成功';
} catch (PDOException $e) {
    die();
    exit();
    echo $e->getMessage();
}

